package com.ruoyi.customerSample.service.impl;


import com.ruoyi.customerSample.domain.Customer;
import com.ruoyi.customerSample.mapper.CustomerMapper;
import com.ruoyi.customerSample.service.ICustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 受检单位信息Service业务层处理
 * 
 * @author luguanqing
 * @date 2020-11-10
 */
@Service
public class CustomerServiceImpl implements ICustomerService
{
    @Autowired(required = false)
    private CustomerMapper customerMapper;

    /**
     * 查询受检单位信息
     * 
     * @param id 受检单位信息ID
     * @return 受检单位信息
     */
    @Override
    public Customer selectReportCompanyById(String id)
    {
        return customerMapper.selectCustomerById(id);
    }


    /**
     * 根据公司名查询信息
     * @param companyName
     * @return
     */
    @Override
    public Customer selectReportCompanyByName(String companyName) {
        return customerMapper.selectCustomerByName(companyName);
    }

    /**
     * 查询受检单位信息列表
     * 
     * @param reportCompany 受检单位信息
     * @return 受检单位信息
     */
    @Override
    public List<Customer> selectReportCompanyList(Customer reportCompany)
    {
        return customerMapper.selectCustomerList(reportCompany);
    }

    /**
     * 新增受检单位信息
     * 
     * @param reportCompany 受检单位信息
     * @return 结果
     */
    @Override
    public int insertReportCompany(Customer reportCompany)
    {
        return customerMapper.insertCustomer(reportCompany);
    }

    /**
     * 修改受检单位信息
     * 
     * @param reportCompany 受检单位信息
     * @return 结果
     */
    @Override
    public int updateReportCompany(Customer reportCompany)
    {
        return customerMapper.updateCustomer(reportCompany);
    }

    /**
     * 批量删除受检单位信息
     * 
     * @param ids 需要删除的受检单位信息ID
     * @return 结果
     */
    @Override
    public int deleteReportCompanyByIds(String[] ids)
    {
        return customerMapper.deleteCustomerByIds(ids);
    }

    /**
     * 删除受检单位信息信息
     * 
     * @param id 受检单位信息ID
     * @return 结果
     */
    @Override
    public int deleteReportCompanyById(String id)
    {
        return customerMapper.deleteCustomerById(id);
    }
}
